19 Jun, 2009

1 commit

  • Several code paths in reiserfs have a construct like:

    if (is_direntry_le_ih(ih = B_N_PITEM_HEAD(src, item_num))) ...

    which, in addition to being ugly, end up causing compiler warnings with
    gcc 4.4.0. Previous compilers didn't issue a warning.

    fs/reiserfs/do_balan.c:1273: warning: operation on `aux_ih' may be undefined
    fs/reiserfs/lbalance.c:393: warning: operation on `ih' may be undefined
    fs/reiserfs/lbalance.c:421: warning: operation on `ih' may be undefined
    fs/reiserfs/lbalance.c:777: warning: operation on `ih' may be undefined

    I believe this is due to the ih being passed to macros which evaluate the
    argument more than once. This is old code and we haven't seen any
    problems with it, but this patch eliminates the warnings.

    It converts the multiple evaluation macros to static inlines and does a
    preassignment for the cases that were causing the warnings because that
    code is just ugly.

    Reported-by: Chris Mason
    Signed-off-by: Jeff Mahoney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     

12 Jun, 2009

5 commits

  • [xfs, btrfs, capifs, shmem don't need BKL, exempt]

    Signed-off-by: Alessio Igor Bogani
    Signed-off-by: Al Viro

    Alessio Igor Bogani
     
  • Move BKL into ->put_super from the only caller. A couple of
    filesystems had trivial enough ->put_super (only kfree and NULLing of
    s_fs_info + stuff in there) to not get any locking: coda, cramfs, efs,
    hugetlbfs, omfs, qnx4, shmem, all others got the full treatment. Most
    of them probably don't need it, but I'd rather sort that out individually.
    Preferably after all the other BKL pushdowns in that area.

    [AV: original used to move lock_super() down as well; these changes are
    removed since we don't do lock_super() at all in generic_shutdown_super()
    now]
    [AV: fuse, btrfs and xfs are known to need no damn BKL, exempt]

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • Make sure a superblock really is writeable by checking MS_RDONLY
    under s_umount. sync_filesystems needed some re-arragement for
    that, but all but one sync_filesystem caller had the correct locking
    already so that we could add that check there. cachefiles grew
    s_umount locking.

    I've also added a WARN_ON to sync_filesystem to assert this for
    future callers.

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • We just did a full fs writeout using sync_filesystem before, and if
    that's not enough for the filesystem it can perform it's own writeout
    in ->put_super, which many filesystems already do.

    Move a call to foofs_write_super into every foofs_put_super for now to
    guarantee identical behaviour until it's cleaned up by the individual
    filesystem maintainers.

    Exceptions:

    - affs already has identical copy & pasted code at the beginning of
    affs_put_super so no need to do it twice.
    - xfs does the right thing without it and I have changes pending for
    the xfs tree touching this are so I don't really need conflicts
    here..

    Signed-off-by: Christoph Hellwig
    Signed-off-by: Al Viro

    Christoph Hellwig
     
  • This patch adds an -oexpose_privroot option to allow access to the privroot.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Al Viro

    Jeff Mahoney
     

18 May, 2009

3 commits


09 May, 2009

6 commits

  • Put generic_show_options read access to s_options under rcu_read_lock,
    split save_mount_options() into "we are setting it the first time"
    (uses in foo_fill_super()) and "we are relacing and freeing the old one",
    synchronize_rcu() before kfree() in the latter.

    Signed-off-by: Al Viro

    Al Viro
     
  • With Al Viro's patch to move privroot lookup to fs mount, there's no need
    to have special code to hide the privroot in reiserfs_lookup.

    I've also cleaned up the privroot hiding in reiserfs_readdir_dentry and
    removed the last user of reiserfs_xattrs().

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Al Viro

    Jeff Mahoney
     
  • The security.* xattrs are ignored for xattr files, so don't create them.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Al Viro

    Jeff Mahoney
     
  • The xattr_root caching was broken from my previous patch set. It wouldn't
    cause corruption, but could cause decreased performance due to allocating
    a larger chunk of the journal (~ 27 blocks) than it would actually use.

    This patch loads the xattr root dentry at xattr initialization and creates
    it on-demand. Since we're using the cached dentry, there's no point
    in keeping lookup_or_create_dir around, so that's removed.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Al Viro

    Jeff Mahoney
     
  • ... even if it's a negative dentry. That way we can set ->d_op on
    root before anyone could race with us. Simplify d_compare(), while
    we are at it.

    Signed-off-by: Al Viro

    Al Viro
     
  • 2.6.30-rc3 introduced some sanity checks in the VFS code to avoid NFS
    bugs by ensuring that lookup_one_len is always called under i_mutex.

    This patch expands the i_mutex locking to enclose lookup_one_len. This was
    always required, but not not enforced in the reiserfs code since it
    does locking around the xattr interactions with the xattr_sem.

    This is obvious enough, and it survived an overnight 50 thread ACL test.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Al Viro

    Jeff Mahoney
     

03 Apr, 2009

2 commits

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs-2.6:
    Remove two unneeded exports and make two symbols static in fs/mpage.c
    Cleanup after commit 585d3bc06f4ca57f975a5a1f698f65a45ea66225
    Trim includes of fdtable.h
    Don't crap into descriptor table in binfmt_som
    Trim includes in binfmt_elf
    Don't mess with descriptor table in load_elf_binary()
    Get rid of indirect include of fs_struct.h
    New helper - current_umask()
    check_unsafe_exec() doesn't care about signal handlers sharing
    New locking/refcounting for fs_struct
    Take fs_struct handling to new file (fs/fs_struct.c)
    Get rid of bumping fs_struct refcount in pivot_root(2)
    Kill unsharing fs_struct in __set_personality()

    Linus Torvalds
     
  • Make reiserfs3 return f_fsid info for statfs(2). By Andreas' suggestion,
    this patch populates a persistent f_fsid between boots/mounts with help of
    on-disk uuid record.

    Randy Dunlap reported a compiling error from v2 patch like:
    fs/built-in.o: In function `reiserfs_statfs':
    super.c:(.text+0x7332b): undefined reference to `crc32_le'
    super.c:(.text+0x7333f): undefined reference to `crc32_le'
    Also he provided helpful solution to fix this error. The modification of v3
    patch is based on Randy's suggestion, add 'select CRC32' in fs/reiserfs/Kconfig.

    Signed-off-by: Coly Li
    Cc: Randy Dunlap
    Cc: Jeff Mahoney
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Coly Li
     

01 Apr, 2009

1 commit


31 Mar, 2009

22 commits

  • * 'proc-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/adobriyan/proc:
    Revert "proc: revert /proc/uptime to ->read_proc hook"
    proc 2/2: remove struct proc_dir_entry::owner
    proc 1/2: do PDE usecounting even for ->read_proc, ->write_proc
    proc: fix sparse warnings in pagemap_read()
    proc: move fs/proc/inode-alloc.txt comment into a source file

    Linus Torvalds
     
  • This patch ifdefs xattr_create when xattrs aren't enabled.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • Setting ->owner as done currently (pde->owner = THIS_MODULE) is racy
    as correctly noted at bug #12454. Someone can lookup entry with NULL
    ->owner, thus not pinning enything, and release it later resulting
    in module refcount underflow.

    We can keep ->owner and supply it at registration time like ->proc_fops
    and ->data.

    But this leaves ->owner as easy-manipulative field (just one C assignment)
    and somebody will forget to unpin previous/pin current module when
    switching ->owner. ->proc_fops is declared as "const" which should give
    some thoughts.

    ->read_proc/->write_proc were just fixed to not require ->owner for
    protection.

    rmmod'ed directories will be empty and return "." and ".." -- no harm.
    And directories with tricky enough readdir and lookup shouldn't be modular.
    We definitely don't want such modular code.

    Removing ->owner will also make PDE smaller.

    So, let's nuke it.

    Kudos to Jeff Layton for reminding about this, let's say, oversight.

    http://bugzilla.kernel.org/show_bug.cgi?id=12454

    Signed-off-by: Alexey Dobriyan

    Alexey Dobriyan
     
  • * reiserfs-updates: (35 commits)
    reiserfs: rename [cn]_* variables
    reiserfs: rename p_._ variables
    reiserfs: rename p_s_tb to tb
    reiserfs: rename p_s_inode to inode
    reiserfs: rename p_s_bh to bh
    reiserfs: rename p_s_sb to sb
    reiserfs: strip trailing whitespace
    reiserfs: cleanup path functions
    reiserfs: factor out buffer_info initialization
    reiserfs: add atomic addition of selinux attributes during inode creation
    reiserfs: use generic readdir for operations across all xattrs
    reiserfs: journaled xattrs
    reiserfs: use generic xattr handlers
    reiserfs: remove i_has_xattr_dir
    reiserfs: make per-inode xattr locking more fine grained
    reiserfs: eliminate per-super xattr lock
    reiserfs: simplify xattr internal file lookups/opens
    reiserfs: Clean up xattrs when REISERFS_FS_XATTR is unset
    reiserfs: remove IS_PRIVATE helpers
    reiserfs: remove link detection code
    ...

    Fixed up conflicts manually due to:
    - quota name cleanups vs variable naming changes:
    fs/reiserfs/inode.c
    fs/reiserfs/namei.c
    fs/reiserfs/stree.c
    fs/reiserfs/xattr.c
    - exported include header cleanups
    include/linux/reiserfs_fs.h

    Linus Torvalds
     
  • This patch renames n_, c_, etc variables to something more sane. This
    is the sixth in a series of patches to rip out some of the awful
    variable naming in reiserfs.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch is a simple s/p_._//g to the reiserfs code. This is the
    fifth in a series of patches to rip out some of the awful variable
    naming in reiserfs.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch is a simple s/p_s_tb/tb/g to the reiserfs code. This is the
    fourth in a series of patches to rip out some of the awful variable
    naming in reiserfs.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch is a simple s/p_s_inode/inode/g to the reiserfs code. This
    is the third in a series of patches to rip out some of the awful
    variable naming in reiserfs.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch is a simple s/p_s_bh/bh/g to the reiserfs code. This is the
    second in a series of patches to rip out some of the awful variable
    naming in reiserfs.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch is a simple s/p_s_sb/sb/g to the reiserfs code. This is the
    first in a series of patches to rip out some of the awful variable
    naming in reiserfs.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch strips trailing whitespace from the reiserfs code.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This patch cleans up some redundancies in the reiserfs tree path code.

    decrement_bcount() is essentially the same function as brelse(), so we use
    that instead.

    decrement_counters_in_path() is exactly the same function as pathrelse(), so
    we kill that and use pathrelse() instead.

    There's also a bit of cleanup that makes the code a bit more readable.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • This is the first in a series of patches to make balance_leaf() not
    quite so insane.

    This patch factors out the open coded initializations of buffer_info
    structures and defines a few initializers for the 4 cases they're used.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • Some time ago, some changes were made to make security inode attributes
    be atomically written during inode creation. ReiserFS fell behind in
    this area, but with the reworking of the xattr code, it's now fairly
    easy to add.

    The following patch adds the ability for security attributes to be added
    automatically during inode creation.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • The current reiserfs xattr implementation open codes reiserfs_readdir
    and frees the path before calling the filldir function. Typically, the
    filldir function is something that modifies the file system, such as a
    chown or an inode deletion that also require reading of an inode
    associated with each direntry. Since the file system is modified, the
    path retained becomes invalid for the next run. In addition, it runs
    backwards in attempt to minimize activity.

    This is clearly suboptimal from a code cleanliness perspective as well
    as performance-wise.

    This patch implements a generic reiserfs_for_each_xattr that uses the
    generic readdir and a specific filldir routine that simply populates an
    array of dentries and then performs a specific operation on them. When
    all files have been operated on, it then calls the operation on the
    directory itself.

    The result is a noticable code reduction and better performance.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • Deadlocks are possible in the xattr code between the journal lock and the
    xattr sems.

    This patch implements journalling for xattr operations. The benefit is
    twofold:
    * It gets rid of the deadlock possibility by always ensuring that xattr
    write operations are initiated inside a transaction.
    * It corrects the problem where xattr backing files aren't considered any
    differently than normal files, despite the fact they are metadata.

    I discussed the added journal load with Chris Mason, and we decided that
    since xattrs (versus other journal activity) is fairly rare, the introduction
    of larger transactions to support journaled xattrs wouldn't be too big a deal.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • Christoph Hellwig had asked me quite some time ago to port the reiserfs
    xattrs to the generic xattr interface.

    This patch replaces the reiserfs-specific xattr handling code with the
    generic struct xattr_handler.

    However, since reiserfs doesn't split the prefix and name when accessing
    xattrs, it can't leverage generic_{set,get,list,remove}xattr without
    needlessly reconstructing the name on the back end.

    Update 7/26/07: Added missing dput() to deletion path.
    Update 8/30/07: Added missing mark_inode_dirty when i_mode is used to
    represent an ACL and no previous ACL existed.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • With the changes to xattr root locking, the i_has_xattr_dir flag
    is no longer needed. This patch removes it.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • The per-inode locking can be made more fine-grained to surround just the
    interaction with the filesystem itself. This really only applies to
    protecting reads during a write, since concurrent writes are barred with
    inode->i_mutex at the vfs level.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • With the switch to using inode->i_mutex locking during lookups/creation
    in the xattr root, the per-super xattr lock is no longer needed.

    This patch removes it.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • The xattr file open/lookup code is needlessly complex. We can use
    vfs-level operations to perform the same work, and also simplify the
    locking constraints. The locking advantages will be exploited in future
    patches.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney
     
  • The current reiserfs xattr implementation will not clean up old xattr
    files if files are deleted when REISERFS_FS_XATTR is unset. This
    results in inaccessible lost files, wasting space.

    This patch compiles in basic xattr knowledge, such as how to delete them
    and change ownership for quota tracking. If the file system has never
    used xattrs, then the operation is quite fast: it returns immediately
    when it sees there is no .reiserfs_priv directory.

    Signed-off-by: Jeff Mahoney
    Signed-off-by: Linus Torvalds

    Jeff Mahoney