lkml.org 
[lkml]   [2003]   [May]   [4]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [RFC] how to fix is_local_disk()?
    Christoph Hellwig <hch@lst.de> wrote:
    >
    > ...
    > +static void do_emergency_remount(unsigned long foo)
    > +{
    > + struct super_block *sb;
    > +
    > + spin_lock(&sb_lock);
    > + list_for_each_entry(sb, &super_blocks, s_list) {
    > + sb->s_count++;
    > + spin_unlock(&sb_lock);
    > + down_read(&sb->s_umount);
    > + if (sb->s_bdev && !(sb->s_flags & MS_RDONLY))
    > + do_remount_sb(sb, MS_RDONLY, NULL, 1);
    > + drop_super(sb);

    You might need to check sb->s_root in here after acquiring sb->s_umount.
    Otherwise the fs may have been unmounted while the semaphore was being waited
    upon.

    About half of the s_umount grabbers perform that check. The others might be
    buggy. I'm not sure - it's all rather gunky in there and hard to tell what
    the rules are.


    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    \
     
     \ /
      Last update: 2005-03-22 13:35    [W:0.019 / U:33.032 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site