Skip to contentSkip to conversation

afs: proc cells and rootcell are writeable

PATCH In review Pali Rohár 3 participants 6 messages Nov 20, 2013 – Dec 31, 2013 Afs filesystem

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 afs: proc cells and rootcell are writeable

Both proc files are writeable and used for configuring cells. But there is missing correct mode flag for writeable files. Without this patch both proc files are read only.

fs/afs/proc.c +2 -2
index 526e4bb..276cb6e 100644
@@ -147,11 +147,11 @@ int afs_proc_init(void)
 	if (!proc_afs)
 		goto error_dir;
 
-	p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops);
+	p = proc_create("cells", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_cells_fops);
 	if (!p)
 		goto error_cells;
 
-	p = proc_create("rootcell", 0, proc_afs, &afs_proc_rootcell_fops);
+	p = proc_create("rootcell", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_rootcell_fops);
 	if (!p)
 		goto error_rootcell;
 
Signature · 2 lines
Pali Rohár
[email protected]
#1 lore raw
Quoted 12 lines · On Wednesday 20 November 2013 14:30:55 Pali Rohár wrote:

Both proc files are writeable and used for configuring cells. But there is missing correct mode flag for writeable files. Without this patch both proc files are read only.

fs/afs/proc.c +0 -0
index 526e4bb..276cb6e 100644
@@ -147,11 +147,11 @@ int afs_proc_init(void)
 	if (!proc_afs)
 		goto error_dir;
 

fs/afs/proc.c int afs_proc_init(void) · line 156

Quoted 10 lines
fs/afs/proc.c +1 -2
-	p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops);
+	p = proc_create("cells", S_IFREG | S_IRUGO | S_IWUSR,
 proc_afs, &afs_proc_cells_fops); if (!p)
 		goto error_cells;
 
-	p = proc_create("rootcell", 0, proc_afs,
 &afs_proc_rootcell_fops); +	p = proc_create("rootcell",
 S_IFREG | S_IRUGO | S_IWUSR, proc_afs,
 &afs_proc_rootcell_fops); if (!p)
 		goto error_rootcell;

Hello, can somebody review my patch?

Signature · 2 lines
Pali Rohár
[email protected]
#2 lore raw
In reply to Pali Rohár
Quoted 11 lines · On Wed, 20 Nov 2013 14:30:55 +0100 Pali Roh__r <[email protected]> wrote:

Both proc files are writeable and used for configuring cells. But there is missing correct mode flag for writeable files. Without this patch both proc files are read only.

fs/afs/proc.c +0 -0
index 526e4bb..276cb6e 100644
@@ -147,11 +147,11 @@ int afs_proc_init(void)
 	if (!proc_afs)
 		goto error_dir;

fs/afs/proc.c int afs_proc_init(void) · line 156

Quoted 10 lines
fs/afs/proc.c +2 -2
 
-	p = proc_create("cells", 0, proc_afs, &afs_proc_cells_fops);
+	p = proc_create("cells", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_cells_fops);
 	if (!p)
 		goto error_cells;
 
-	p = proc_create("rootcell", 0, proc_afs, &afs_proc_rootcell_fops);
+	p = proc_create("rootcell", S_IFREG | S_IRUGO | S_IWUSR, proc_afs, &afs_proc_rootcell_fops);
 	if (!p)
 		goto error_rootcell;

Please send a signed-off-by: for this, as per
Documentation/SubmittingPatches, section 12.

David ack?

#3 lore raw
Quoted 1 line · On Monday 16 December 2013 08:00:04 Andrew Morton wrote:

On Wed, 20 Nov 2013 14:30:55 +0100 Pali Roh__r

Quoted 27 lines · <[email protected]> wrote:
Quoted 27 lines

Both proc files are writeable and used for configuring cells. But there is missing correct mode flag for writeable files. Without this patch both proc files are read only.

fs/afs/proc.c +0 -1
index 526e4bb..276cb6e 100644
@@ -147,11 +147,11 @@ int afs_proc_init(void)
 
 	if (!proc_afs)
 
 		goto error_dir;
 
-	p = proc_create("cells", 0, proc_afs,

&afs_proc_cells_fops); + p = proc_create("cells", S_IFREG |
S_IRUGO | S_IWUSR, proc_afs, &afs_proc_cells_fops);

fs/afs/proc.c +0 -1
 	if (!p)
 
 		goto error_cells;
 
-	p = proc_create("rootcell", 0, proc_afs,

&afs_proc_rootcell_fops); + p = proc_create("rootcell",
S_IFREG | S_IRUGO | S_IWUSR, proc_afs,
&afs_proc_rootcell_fops);

Quoted 8 lines

fs/afs/proc.c int afs_proc_init(void) · line 156

Quoted 3 lines
fs/afs/proc.c +0 -0
 	if (!p)
 
 		goto error_rootcell;

Please send a signed-off-by: for this, as per
Documentation/SubmittingPatches, section 12.

David ack?

Sorry, I forgot to add Signed-off-by. Here it is:

Signature · 2 lines
Pali Rohár
[email protected]
#5 lore raw
Quoted 9 lines · On Tuesday 17 December 2013 19:31:05 David Howells wrote:
Quoted 1 line · Andrew Morton

David ack?

I've signed it off and added here:

http://git.kernel.org/cgit/linux/kernel/git/dhowells/linux-fs
.git/commit/?h=afs&id=8de69dbba9012693d4f9e7a7e3c12a0b467f85f3

David

Can you propose this patch also for stable branches? Without this patch it is not possible to write to cells and rootcell files which means that it is not possible to add new servers to cells, so it is not possible to access afs disks and afs driver is unusable...

Signature · 2 lines
Pali Rohár
[email protected]