07 Jan, 2012
2 commits
-
Signed-off-by: Al Viro
-
Signed-off-by: Al Viro
04 Jan, 2012
1 commit
-
Signed-off-by: Al Viro
29 Oct, 2011
1 commit
-
* 'for-next' of git://git.kernel.org/pub/scm/linux/kernel/git/hch/vfs-queue: (21 commits)
leases: fix write-open/read-lease race
nfs: drop unnecessary locking in llseek
ext4: replace cut'n'pasted llseek code with generic_file_llseek_size
vfs: add generic_file_llseek_size
vfs: do (nearly) lockless generic_file_llseek
direct-io: merge direct_io_walker into __blockdev_direct_IO
direct-io: inline the complete submission path
direct-io: separate map_bh from dio
direct-io: use a slab cache for struct dio
direct-io: rearrange fields in dio/dio_submit to avoid holes
direct-io: fix a wrong comment
direct-io: separate fields only used in the submission path from struct dio
vfs: fix spinning prevention in prune_icache_sb
vfs: add a comment to inode_permission()
vfs: pass all mask flags check_acl and posix_acl_permission
vfs: add hex format for MAY_* flag values
vfs: indicate that the permission functions take all the MAY_* flags
compat: sync compat_stats with statfs.
vfs: add "device" tag to /proc/self/mountstats
cleanup: vfs: small comment fix for block_invalidatepage
...Fix up trivial conflict in fs/gfs2/file.c (llseek changes)
28 Oct, 2011
1 commit
-
The i_mutex lock use of generic _file_llseek hurts. Independent processes
accessing the same file synchronize over a single lock, even though
they have no need for synchronization at all.Under high utilization this can cause llseek to scale very poorly on larger
systems.This patch does some rethinking of the llseek locking model:
First the 64bit f_pos is not necessarily atomic without locks
on 32bit systems. This can already cause races with read() today.
This was discussed on linux-kernel in the past and deemed acceptable.
The patch does not change that.Let's look at the different seek variants:
SEEK_SET: Doesn't really need any locking.
If there's a race one writer wins, the other loses.For 32bit the non atomic update races against read()
stay the same. Without a lock they can also happen
against write() now. The read() race was deemed
acceptable in past discussions, and I think if it's
ok for read it's ok for write too.=> Don't need a lock.
SEEK_END: This behaves like SEEK_SET plus it reads
the maximum size too. Reading the maximum size would have the
32bit atomic problem. But luckily we already have a way to read
the maximum size without locking (i_size_read), so we
can just use that instead.Without i_mutex there is no synchronization with write() anymore,
however since the write() update is atomic on 64bit it just behaves
like another racy SEEK_SET. On non atomic 32bit it's the same
as SEEK_SET.=> Don't need a lock, but need to use i_size_read()
SEEK_CUR: This has a read-modify-write race window
on the same file. One could argue that any application
doing unsynchronized seeks on the same file is already broken.
But for the sake of not adding a regression here I'm
using the file->f_lock to synchronize this. Using this
lock is much better than the inode mutex because it doesn't
synchronize between processes.=> So still need a lock, but can use a f_lock.
This patch implements this new scheme in generic_file_llseek.
I dropped generic_file_llseek_unlocked and changed all callers.Signed-off-by: Andi Kleen
Signed-off-by: Christoph Hellwig
20 Oct, 2011
3 commits
-
Add support to print nostrictsync and noperm mount options in
/proc/mounts for shares mounted with these options.
(cleanup merge conflict in Sachin's original patch)Suggested-by: Sachin Prabhu
Signed-off-by: Steve French -
Signed-off-by: Jeff Layton
14 Oct, 2011
1 commit
-
that let us do local lock checks before requesting to the server.
Signed-off-by: Pavel Shilovsky
Signed-off-by: Steve French
13 Oct, 2011
3 commits
-
Thus spake Jeff Layton:
"Making that a module parm would allow you to set that parameter at boot
time without needing to add special startup scripts. IMO, all of the
procfile "switches" under /proc/fs/cifs should be module parms
instead."This patch doesn't alter the default behavior (Oplocks are enabled by
default).To disable oplocks when loading the module, use
modprobe cifs enable_oplocks=0
(any of '0' or 'n' or 'N' conventions can be used).
To disable oplocks at runtime using the new interface, use
echo 0 > /sys/module/cifs/parameters/enable_oplocks
The older /proc/fs/cifs/OplockEnabled interface will be deprecated
after two releases. A subsequent patch will add an warning message
about this deprecation.Changes since v2:
- make enable_oplocks a 'bool'Changes since v1:
- eliminate the use of extra variable by renaming the old one to
enable_oplocks and make it an 'int' type.Reported-by: Alexander Swen
Reviewed-by: Jeff Layton
Signed-off-by: Suresh Jayaraman
Signed-off-by: Steve French -
It should be 'CONFIG_CIFS_NFSD_EXPORT'. No-one noticed because that
symbol depends on BROKEN.Signed-off-by: Paul Bolle
Signed-off-by: Steve French -
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
12 Oct, 2011
1 commit
-
Commit d39454ffe4a3c85428483b8a8a8e5e797b6363d5 adds a strictcache mount
option. This patch allows the display of this mount option in
/proc/mounts when listing shares mounted with the strictcache mount
option.Signed-off-by: Sachin Prabhu
Reviewed-by: Jeff Layton
Signed-off-by: Steve French
20 Sep, 2011
1 commit
-
move it to the beginning of the loop.
Signed-off-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Steve French
05 Aug, 2011
1 commit
-
The loop around lookup_one_len doesn't handle the case where it might
return a negative dentry, which can cause an oops on the next pass
through the loop. Check for that and break out of the loop with an
error of -ENOENT if there is one.Fixes the panic reported here:
https://bugzilla.redhat.com/show_bug.cgi?id=727927
Reported-by: TR Bentley
Reported-by: Iain Arnell
Cc: Al Viro
Cc: stable@kernel.org
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
01 Aug, 2011
1 commit
-
Currently, we take a sb->s_active reference and a cifsFileInfo reference
when an oplock break workqueue job is queued. This is unnecessary and
more complicated than it needs to be. Also as Al points out,
deactivate_super has non-trivial locking implications so it's best to
avoid that if we can.Instead, just cancel any pending oplock breaks for this filehandle
synchronously in cifsFileInfo_put after taking it off the lists.
That should ensure that this job doesn't outlive the structures it
depends on.Reported-by: Al Viro
Signed-off-by: Jeff Layton
Signed-off-by: Steve French
21 Jul, 2011
1 commit
-
This converts everybody to handle SEEK_HOLE/SEEK_DATA properly. In some cases
we just return -EINVAL, in others we do the normal generic thing, and in others
we're simply making sure that the properly due-dilligence is done. For example
in NFS/CIFS we need to make sure the file size is update properly for the
SEEK_HOLE and SEEK_DATA case, but since it calls the generic llseek stuff itself
that is all we have to do. Thanks,Signed-off-by: Josef Bacik
Signed-off-by: Al Viro
20 Jul, 2011
3 commits
-
not used by the instances anymore.
Signed-off-by: Al Viro
-
redundant; all callers get it duplicated in mask & MAY_NOT_BLOCK and none of
them removes that bit.Signed-off-by: Al Viro
-
its value depends only on inode and does not change; we might as
well store it in ->i_op->check_acl and be done with that.Signed-off-by: Al Viro
19 Jul, 2011
1 commit
-
Add missing ->i_mutex, convert to lookup_one_len() instead of
(broken) open-coded analog, cope with getting something like
a//b as relative pathname. Simplify the hell out of it, while
we are there...Signed-off-by: Al Viro
Reviewed-by: Jeff Layton
08 Jul, 2011
1 commit
-
Signed-off-by: Jeff Layton
Reviewed-by: Pavel Shilovsky
Signed-off-by: Steve French
07 Jul, 2011
1 commit
-
...as that makes for a cumbersome interface. Make it take a regular
smb_vol pointer and rely on the caller to zero it out if needed.Signed-off-by: Jeff Layton
Reviewed-by: Pavel Shilovsky
Signed-off-by: Steve French
25 Jun, 2011
15 commits
-
... instead of just failing with -EINVAL
Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
if cifs_get_root() fails, we end up with ->mount() returning NULL,
which is not what callers expect. Moreover, in case of superblock
reuse we end up leaking a superblock reference...Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
have ->s_fs_info set by the set() callback passed to sget()
Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
all callers of cifs_umount() proceed to do the same thing; pull it into
cifs_umount() itself.Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
instead of calling it manually in case if cifs_read_super() fails
to set ->s_root, just call it from ->kill_sb(). cifs_put_super()
is gone now *and* we have cifs_sb shutdown and destruction done
after the superblock is gone from ->s_instances.Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
... to the point prior to sget(). Now we have cifs_sb set up early
enough.Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
a) superblock argument is unused
b) it always returns 0Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
no need to wait until cifs_read_super() and we need it done
by the time cifs_mount() will be called.Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
pull mountdata allocation up, so that it won't stand in the way when
we lift cifs_mount() to location before sget().Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
cifs_sb and nls end up leaked...
Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
To close sget() races we'll need to be able to set cifs_sb up before
we get the superblock, so we'll want to be able to do cifs_mount()
earlier. Fortunately, it's easy to do - setting ->s_maxbytes can
be done in cifs_read_super(), ditto for ->s_time_gran and as for
putting MS_POSIXACL into ->s_flags, we can mirror it in ->mnt_cifs_flags
until cifs_read_super() is called. Kill unused 'devname' argument,
while we are at it...Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
if cifs_sb allocation fails, we still need to drop nls we'd stashed
into volume_info - the one we would've copied to cifs_sb if we could
allocate the latter.Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
if we get to out_super with ->s_root already set (e.g. with
cifs_get_root() failure), we'll end up with cifs_put_super()
called and ->mountdata freed twice. We'll also get cifs_sb
freed twice and cifs_sb->local_nls dropped twice. The problem
is, we can get to out_super both with and without ->s_root,
which makes ->put_super() a bad place for such work.Switch to ->kill_sb(), have all that work done there after
kill_anon_super(). Unlike ->put_super(), ->kill_sb() is
called by deactivate_locked_super() whether we have ->s_root
or not.Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro -
Acked-by: Pavel Shilovsky
Reviewed-by: Jeff Layton
Signed-off-by: Al Viro
20 Jun, 2011
1 commit
-
nothing potentially blocking except generic_permission(), which
will DTRTSigned-off-by: Al Viro
14 Jun, 2011
1 commit
-
Signed-off-by: Jeff Layton
Signed-off-by: Steve French